package com.fittinghome.comsume;

import com.fittinghome.config.MqQueueNames;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.nio.charset.Charset;

@Component
public class DemoConsumer {


    @RabbitListener(queues = MqQueueNames.QUEUE_ORDER_CREATED)
    public void displayMail(byte[] mail) throws Exception {

        String aa =  new String(mail, Charset.forName("utf-8"));
        System.out.println("directqueue1队列监听器1号收到消息"+aa);
    }
}
